/**
 * 
 */
package specialtriggers;

import lastfm.LastFm;
import trigger.VariableTrigger;

/**
 * @author Philip
 *
 */
public class NowPlayingTrigger extends VariableTrigger {
	private LastFm lastFm = new LastFm();
	private String input;

	public NowPlayingTrigger(String trigger) {
		super(trigger, "", 2);
	}

	public String response(int i) {
		String user = input.substring(input.indexOf("!np ") + 4);		
		return lastFm.getNowPlaying(user);
	}
	
	public void updateVariables(String nickName, String sender, String receiver, String senderHostname, String input) {
		this.input = input;
		super.updateVariables(nickName, sender, receiver, senderHostname, input);
	}
}
